import request from '@/utils/request.js'


/**
 * inviter_code,
			accessToken
 * @param {*} accessToken 
 */
export function oneLogin(data) {
	return request({
		url: "/user/aliPhoneOauth",
		method: 'POST',
		data
	})
}



/**
 *用户登录 
 * @param {*} data 
 */
export function login(data, loginType = 1) {
	return request({
		url: loginType == 1 ? '/user/login' : '/user/LoginForMobile',
		method: "POST",
		data
	})
}



/**
 *用户一键登录 
 * @param {*} data 
 */
export function aliPhoneOauth(data) {
	return request({
		url: '/user/aliPhoneOauth',
		method: "POST",
		data
	})
}



/**
 *获取用户信息
 * @param {*} data 
 */
export function getUserInfo() {
	return request({
		url: '/user/getUserInfo',
		method: "POST",
	})
}


/**
 * 获取验证码
 * @param {*} data 
 */
export function sendSms(data) {
	return request({
		url: '/sms/send',
		method: "POST",
		data
	})
}



/**
 * 注册
 * @param {*} data 
 */
export function register(data) {
	return request({
		url: '/user/register',
		method: "POST",
		data
	})
}


/**
 * 修改用户信息
 */
export function updateUserInfo(data) {
	return request({
		url: '/user/profile',
		method: "POST",
		data
	})
}


/**
 * 申请实名认证
 */
export function applyCertAuth(data) {
	return request({
		url: '/user/RealAuthentication',
		method: "POST",
		data
	})
}



/**
 * 获取银行卡绑定信息
 */
export function getBankInfo() {
	return request({
		url: '/user/getBankInfo',
		method: "POST",
	})
}


/*
 *绑定银行卡
 */
export function bindBank(data) {
	return request({
		url: '/user/bindBank',
		method: "POST",
		data
	})
}

/**
 * 设置操作密码
 * @param {Object} data 
 */
export function setActionPwd(data) {
	return request({
		url: '/user/setPayPassword',
		method: "POST",
		data
	})
}

/**
 *重置密码 
 * @param {*} data 
 */
export function resetLoginPwd(data) {
	return request({
		url: '/user/resetpwd',
		method: "POST",
		data
	})
}

/**
 * 搜索用户
 * @param {Object} data 
 */
export function searchUser(data) {
	return request({
		url: '/user/ParamsToUser',
		method: "POST",
		data
	})
}

/**
 *申请成为发行方 
 * @param {*} data 
 */
export function applyIssuer(data) {
	return request({
		url: '/user/applyIssuer',
		method: "POST",
		data
	})
}


/**
 * 获取自身发行方信息
 */
export function getSelfIssuerInfo() {
	return request({
		url: '/user/getIssuer',
		method: "GET"
	})
}


/**验证操作密码
 * @param {Object} data
 */
export function cehckPayPassword(data) {
	return request({
		url: '/user/checkPaypass',
		method: "POST",
		data
	})
}

// 流转记录
export function flowDoc(data) {
	return request({
		url: '/user_collection/user_collection/getRecord',
		method: "POST",
		data
	})
}



/**
 *注销账号 
 **/
export function delAccount(payPassword) {
	return request({
		url: '/user/delAccount',
		method: "post",
		data: {
			payPassword
		}
	})
}

/**
 *返佣信息 
 **/
export function commision_info() {
	return request({
		url: '/user/commision_info',
		method: "post"
	})
}
// 被邀请人清单
export function bei_yao_list(data) {
	return request({
		url: '/user/bei_yao_list',
		method: "POST",
		data
	})
}
//邀请榜单
export function commison_rank(data) {
	return request({
		url: '/user/commison_rank',
		method: "POST",
		data
	})
}

//获取盈亏信息
export function collection_price_trend(data) {
	return request({
		url: '/user/collection_price_trend',
		method: "POST",
		data
	})
}

//今日热门排行
export function today_hot_rank(data) {
	return request({
		url: '/user/today_hot_rank',
		method: "POST",
		data
	})
}

export function aliH5GetAuthToken(data) {
	return request({
		url: '/user/aliH5GetAuthToken',
		method: "POST",
		data
	})
}

export function aliH5PhoneOauth(data) {
	return request({
		url: '/user/aliH5PhoneOauth',
		method: "POST",
		data
	})
}



